import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('content')
export class Content {
  @PrimaryGeneratedColumn({ name: 'content_id', comment: '内容id' })
  contentId: number;

  @Column({ name: 'image_id', default: 0, comment: '图片id' })
  imageId: number;

  @Column({ length: 255, default: '', comment: '名称' })
  name: string;

  @Column({ length: 127, nullable: true, comment: '文章类型' })
  type: string;

  @Column({ name: 'release_time', type: 'datetime', nullable: true, comment: '发布时间' })
  releaseTime: Date;

  @Column({ length: 127, default: '', comment: '标识（唯一）' })
  unique: string;

  @Column({ length: 255, default: '', comment: '来源' })
  source: string;

  @Column({ length: 255, default: '', comment: '作者' })
  author: string;

  @Column({ length: 255, default: '', comment: '链接' })
  url: string;

  @Column({ length: 255, default: '', comment: '标题' })
  title: string;

  @Column({ length: 255, default: '', comment: '关键词' })
  keywords: string;

  @Column({ length: 255, default: '', comment: '描述' })
  description: string;

  @Column({ type: 'mediumtext', nullable: true, comment: '内容' })
  content: string;

  @Column({ default: 250, comment: '排序' })
  sort: number;

  @Column({ length: 255, default: '', comment: '备注' })
  remark: string;

  @Column({ default: 0, comment: '实际点击量' })
  hits: number;

  @Column({ name: 'hits_initial', default: 0, comment: '初始点击量' })
  hitsInitial: number;

  @Column({ name: 'is_top', type: 'tinyint', width: 1, default: 0, comment: '是否置顶，1是0否' })
  isTop: number;

  @Column({ name: 'is_hot', type: 'tinyint', width: 1, default: 0, comment: '是否热门，1是0否' })
  isHot: number;

  @Column({ name: 'is_rec', type: 'tinyint', width: 1, default: 0, comment: '是否推荐，1是0否' })
  isRec: number;

  @Column({ name: 'is_disable', type: 'tinyint', width: 1, default: 0, comment: '是否禁用，1是0否' })
  isDisable: number;

  @Column({ name: 'is_delete', type: 'tinyint', width: 1, default: 0, comment: '是否删除，1是0否' })
  isDelete: number;

  @Column({ name: 'create_uid', default: 0, comment: '添加用户id' })
  createUid: number;

  @Column({ name: 'update_uid', default: 0, comment: '修改用户id' })
  updateUid: number;

  @Column({ name: 'delete_uid', default: 0, comment: '删除用户id' })
  deleteUid: number;

  @Column({ name: 'create_time', type: 'datetime', nullable: true, comment: '添加时间' })
  createTime: Date;

  @Column({ name: 'update_time', type: 'datetime', nullable: true, comment: '修改时间' })
  updateTime: Date;

  @Column({ name: 'delete_time', type: 'datetime', nullable: true, comment: '删除时间' })
  deleteTime: Date;

  @Column({ default: 0, comment: '附加id' })
  addon1: number;
}